<template>
  <div>
    <Card dis-hover>
      <Form :label-width="100" :model="formData">
        <Row type="flex" style="flex-wrap: wrap">
          <FormItem label="分类：">
            <Input
              v-model="formData.categoryPath"
              readonly
              placeholder="请输入内容"
              style="width: 200px"
              @on-search="selctCategory"
              search
              enter-button
            />
          </FormItem>
          <FormItem label="SPU编码：">
            <Input
              v-model="formData.spuNo"
              placeholder="请输入SPU编码"
              style="width: 150px"
            />
          </FormItem>
          <FormItem label="SKU编码：">
            <Input
              v-model="formData.skuNo"
              placeholder="请输入SKU编码"
              style="width: 150px"
            />
          </FormItem>
          <FormItem label="商品类型：">
            <Select
              v-model="formData.productType"
              :transfer="true"
              style="width: 150px"
            >
              <Option
                v-for="(item, index) in productTypeList"
                :value="item.value"
                :key="index"
                >{{ item.label }}
              </Option>
            </Select>
          </FormItem>
          <FormItem label="商品品牌：">
            <Input
              v-model="formData.brandName"
              placeholder="请输入内容"
              style="width: 150px"
            />
          </FormItem>
          <FormItem label="商品名称：">
            <Input
              v-model="formData.productName"
              placeholder="请输入内容"
              style="width: 150px"
            />
          </FormItem>
          <FormItem label="规格：">
            <Input
              v-model="formData.specDetailStr"
              placeholder="请输入内容"
              style="width: 150px"
            />
          </FormItem>
          <FormItem label="存量属性：">
            <Select
              v-model="formData.logisticsStock"
              :transfer="true"
              style="width: 150px"
              clearable
            >
              <Option
                v-for="(item, index) in logisticsStockOptions"
                :value="item.value"
                :key="index"
                >{{ item.label }}
              </Option>
            </Select>
          </FormItem>
        </Row>
        <Row style="padding-bottom: 16px" justify="end" type="flex">
          <Button
            v-if="showBtn('查询')"
            type="primary"
            @click="queryTableBt('1')"
            >查询</Button
          >
          <Button style="margin-left: 20px" @click="queryTableBt('0')"
            >清空</Button
          >
        </Row>
      </Form>
      <Row class="format_table_wrap">
        <Row style="padding-bottom: 16px" justify="start" type="flex">
          <!-- 产品让先隐藏 -->
          <!-- <Button type="primary"
                  @click="settingColumn">设置列</Button> -->
          <Button
            v-if="showBtn('导出')"
            type="primary"
            :loading="btnLoading.export"
            style="margin-left: 20px"
            @click="exportTable"
            >导出</Button
          >
        </Row>
        <Table
          :columns="columns"
          :data="baseTableData"
          :loading="loading"
          height='500'
          @on-select="handleBaseTablaeSelect"
        >
          <template slot-scope="{ row }" slot="action">
            <a
              v-if="showBtn('修改')"
              @click="toEdit(row)"
              style="margin-right: 15px"
              >编辑</a
            >
            <a @click="toView(row)">查看</a>
            <a
              v-if="showBtn('图文编辑')"
              @click="handleToGraphicPage(row)"
              style="margin-right: 15px; margin-left: 15px"
              >图文</a
            >
          </template>
        </Table>
        <div class="ivu-mt ivu-text-center">
          <Page
            transfer
            :total="totalNum"
            show-total
            show-sizer
            show-elevator
            :current.sync="nowPage"
            @on-change="initData"
            @on-page-size-change="handleChangePage"
          />
        </div>
      </Row>
    </Card>
    <Modal
      v-model="onSearchClassifyModal"
      title="选择分类"
      width="1000"
      @on-ok="saveClassifyFun"
    >
      <div>
        <div>
          <Row :gutter="24">
            <Col v-bind="classifyGrid">
              <div style="height: 290px; overflow-y: auto">
                <Menu active-name="" width="auto" @on-select="selectFirstMenu">
                  <MenuItem
                    :name="item.nowTime"
                    v-for="(item, index) in menuData1"
                    :key="index"
                  >
                    {{ item.categoryName }}
                    <Icon type="ios-arrow-forward" />
                  </MenuItem>
                </Menu>
              </div>
            </Col>
            <Col v-bind="classifyGrid">
              <div class="qw-classify">
                <Menu active-name="" width="auto" @on-select="selectSecondMenu">
                  <MenuItem
                    :name="item.nowTime"
                    v-for="(item, index) in menuData2"
                    :key="index"
                  >
                    {{ item.categoryName }}
                    <Icon type="ios-arrow-forward" />
                  </MenuItem>
                </Menu>
              </div>
            </Col>
            <Col v-bind="classifyGrid">
              <div class="qw-classify">
                <Menu active-name="" width="auto" @on-select="selectThirdMenu">
                  <MenuItem
                    :name="item.nowTime"
                    v-for="(item, index) in menuData3"
                    :key="index"
                  >
                    {{ item.categoryName }}
                    <Icon type="ios-arrow-forward" />
                  </MenuItem>
                </Menu>
              </div>
            </Col>
            <Col v-bind="classifyGrid">
              <div class="qw-classify">
                <Menu active-name="" width="auto" @on-select="selectFourthMenu">
                  <MenuItem
                    :name="item.nowTime"
                    v-for="(item, index) in menuData4"
                    :key="index"
                  >
                    {{ item.categoryName }}
                    <Icon type="ios-arrow-forward" />
                  </MenuItem>
                </Menu>
              </div>
            </Col>
          </Row>
        </div>
      </div>
    </Modal>
    <Modal
      v-model="modal2"
      title="选择修改信息模板"
      @on-ok="addModelOkFun()"
    >
      <RadioGroup v-model="myModel" vertical>
        <Radio label="1">
          <span>基本信息模板 （根据SPU维护基本信息）</span>
        </Radio>
        <Radio label="2">
          <span>管理信息模板 （根据SPU维护管理信息）</span>
        </Radio>
        <Radio label="3">
          <span>SKU信息模板 （根据SKU维护包装信息）</span>
        </Radio>
      </RadioGroup>
    </Modal>
    <!-- 分页 end  -->
    <Modal
      v-model="settingColumnModal"
      title="列表设置"
      @on-ok="settingColumnOkFun(1)"
      width="700"
      @on-cancel="settingColumnOkFun(0)"
    >
      <Card dis-hover>
        <Row type="flex" justify="start" align="bottom">
          <Col style="margin-right: 40px; margin: 15px">
            <span style="margin-right: 10px">字段名称</span>
            <Input
              style="width: auto"
              v-model="name"
              placeholder="请输入字段名称"
            ></Input>
          </Col>
          <Col>
            <Button
              type="primary"
              style="margin-right: 10px"
              @click="linkAttributeBt('1')"
              >查询</Button
            >
            <Button @click="linkAttributeBt('0')">清空</Button>
          </Col>
        </Row>
      </Card>
      <Card dis-hover>
        <Table
          ref="table"
          border
          :columns="settingColumnCol"
          @on-select="handleSelect"
          :data="settingColumnData"
        >
          <template slot-scope="{ row, index }" slot="action">
            <a @click="toUp(row, index)" style="margin-right: 15px">上移</a>
            <a @click="toDown(row, index)">下移</a>
          </template>
        </Table>
      </Card>
    </Modal>
  </div>
</template>
<script>
import { ApiRequest } from '@api/basePage';
import { mapGetters } from 'vuex';
import { getBtnsId } from '@/libs/btnsPermission';
import { handleOpenNewPage, createExcelByExport } from '@/utils/bizUtils'
import { PRODUCT_TYPE_OPTIONS, STOCK_PROPERTIES } from '@/constants/commodity';
import { exportSkuManageService } from '@/api/commodity/commodityManage/skuManage';
export default {
  components: {},
  data () {
    return {
      logisticsStockOptions: STOCK_PROPERTIES,
      loading: false,
      btnLoading: {
        export: false
      },
      onSearchClassifyModal: false,
      settingColumnModal: false,
      modal2: false,
      uuid: '',
      myModel: '1',
      productUuid: '',
      supplierCode: '',
      isSaleMultiUnit: '',
      recordNo: '',
      settingColumnData: [],
      formData: {
        productAddState: '',
        categoryPath: '',
        categoryUuid: '',
        spuNo: '',
        skuNo: '',
        productName: '',
        productType: '',
        brandName: '',
        specDetailStr: '',
        logisticsStock: ''
      },
      totalNum: 0,
      pageShow: 10,
      nowPage: 1,
      isSearch: false,
      allPathName: '', // 分类全路径名称
      catograyLevel: '0', // 分类级别
      menuData1: [], // 一级分类菜单
      menuData2: [], // 二级分类菜单
      menuData3: [], // 三级分类菜单
      menuData4: [], // 四级分类菜单
      lastLevel: false,
      isShowResults: false,
      classifyGrid: {
        xl: 6,
        lg: 6,
        md: 6,
        sm: 24,
        xs: 24
      },
      stateList: [
        {
          value: 'PREPARING',
          label: '待准入'
        },
        {
          value: 'FINISH',
          label: '已准入'
        }
      ],
      productTypeList: PRODUCT_TYPE_OPTIONS,
      columns: [
        {
          type: 'selection',
          width: 60,
          fixed: 'left',
          align: 'center'
        },
        {
          title: '分类',
          key: 'categoryPath',
          minWidth: 160
        },
        {
          title: 'SPU编码',
          key: 'spuNo',
          minWidth: 160
        },
        {
          title: 'SKU编码',
          key: 'skuNo',
          minWidth: 160
        },
        {
          title: '创建人',
          key: 'createOperName',
          minWidth: 160
        },
        {
          title: '商品负责人',
          key: 'productDutyPersons',
          minWidth: 160
        },
        {
          title: '商品名称',
          key: 'productName',
          align: 'center',
          minWidth: 120
        },
        {
          title: '规格',
          key: 'specDetailStr',
          align: 'center',
          minWidth: 120
        },
        {
          title: '主计量单位',
          key: 'mainUnitStr',
          align: 'center',
          minWidth: 120
        },
        {
          title: '存量属性',
          key: 'logisticsStock',
          align: 'center',
          minWidth: 120
        },
        {
          title: '商品类型',
          key: 'productTypeStr',
          align: 'center',
          minWidth: 120
        },
        {
          title: '商品管理区域',
          key: 'manageArea',
          align: 'center',
          minWidth: 120
        },
        {
          title: '创建时间',
          key: 'createOpeTime',
          align: 'center',
          minWidth: 120
        },
        {
          title: '品牌',
          key: 'brandName',
          align: 'center',
          minWidth: 120
        },
        {
          title: '操作',
          slot: 'action',
          align: 'center',
          fixed: 'right',
          minWidth: 180
        }
      ],
      settingColumnCol: [
        {
          type: 'selection',
          width: 60,
          fixed: 'left',
          align: 'center'
        },
        {
          title: '类型',
          key: 'typeStr',
          minWidth: 140
        },
        {
          title: '字段名称',
          key: 'name',
          minWidth: 140
        },
        {
          title: '操作',
          slot: 'action',
          align: 'center',
          fixed: 'right',
          minWidth: 140
        }
      ],
      baseTableData: [],
      name: '',
      nameList: [],
      skuNoList: '',
      skuNo: '',
      apiObj: {
        // 查询一级分类
        getLevelOneCategoryList: {
          url: '/sysback/choose/category/getLevelOneCategoryList', // 接口地址
          type: 'post' // 接口请求类型
        },
        // 根据父分类查询子分类
        getByParentUuid: {
          url: '/sysback/choose/category/getByParentUuid', // 接口地址
          type: 'post' // 接口请求类型
        },
        // 获取sku列表数据
        getTableList: {
          url: '/sysback/finish/sku/list/getSkuListForSkuManage', // 接口地址
          type: 'post' // 接口请求类型
        },
        // 查询设置列
        getAllAttrInfoList: {
          url: '/sysback/finish/sku/list/getAllAttrInfoList', // 接口地址
          type: 'post' // 接口请求类型
        },
        // 导出
        exportSkuGet: {
          url: '/sysback/finish/sku/list/exportSkuGet', // 接口地址
          type: 'get' // 接口请求类型
        }
      },
      nowTime: ''
    };
  },
  computed: {
    ...mapGetters('permissions/systemBtns', ['showBtn'])
  },
  // created () {
  //   this.initData();
  // },
  mounted () {},
  methods: {
    handleToGraphicPage (row) {
      handleOpenNewPage(this, {
        path:
          '/commodity/commodityManage/chageFromManage/chageFromManageImageText',
        query: { productUuid: row.productUuid, productName: row.productName, spuNo: row.spuNo, fromType: 'single' }
      });
    },
    getTime () {
      this.nowTime = new Date().toLocaleString();
    },
    // 初始化数据
    initData () {
      let searchParam = [];
      searchParam.push({
        name: 'productAddState',
        value: this.formData.productAddState
      });
      searchParam.push({ name: 'productAddState_q', value: 'EQ' });
      searchParam.push({
        name: 'categoryPath',
        value: this.formData.categoryPath
      });
      searchParam.push({ name: 'categoryPath_q', value: 'Like' });
      searchParam.push({
        name: 'categoryUuid',
        value: this.formData.categoryUuid
      });
      searchParam.push({ name: 'categoryUuid_q', value: 'Like' });
      searchParam.push({ name: 'spuNo', value: this.formData.spuNo });
      searchParam.push({ name: 'spuNo_q', value: 'Like' });
      searchParam.push({ name: 'skuNo', value: this.formData.skuNo });
      searchParam.push({ name: 'skuNo_q', value: 'Like' });
      searchParam.push({
        name: 'productName',
        value: this.formData.productName
      });
      searchParam.push({ name: 'productName_q', value: 'Like' });
      searchParam.push({
        name: 'productType',
        value: this.formData.productType
      });
      searchParam.push({ name: 'productType_q', value: 'EQ' });
      searchParam.push({ name: 'brandName', value: this.formData.brandName });
      searchParam.push({ name: 'brandName_q', value: 'Like' });
      // 此处的规格就是skuName
      searchParam.push({ name: 'specDetail', value: this.formData.specDetailStr });
      searchParam.push({ name: 'specDetail_q', value: 'Like' });
      searchParam.push({ name: 'logisticsStock', value: this.formData.logisticsStock });
      searchParam.push({ name: 'logisticsStock_q', value: 'EQ' });
      let data = {
        nowPage: this.nowPage,
        pageShow: this.pageShow,
        searchParam: JSON.stringify(searchParam),
        sortName: '',
        sortType: ''
      };
      let curBtnId = getBtnsId('查询');
      sessionStorage.setItem('buttonId', curBtnId);
      this.loading = true;
      // 开始请求列表
      ApiRequest(
        this.apiObj.getTableList.url,
        this.apiObj.getTableList.type,
        data
      ).then(res => {
        let rData = res;
        if (rData.retStatus === '1') {
          if (rData.retData !== '') {
            rData.retData = rData.retData;
          }
          if (
            rData.retData.results !== null &&
            rData.retData.results.length > 0
          ) {
            // 增加表格操作项
            this.baseTableData = rData.retData.results;
          } else {
            this.baseTableData = [];
          }

          this.totalNum = rData.retData.totalNum;
        }
        this.loading = false;
      });
    },
    // 选择分类
    selctCategory () {
      this.onSearchClassifyModal = true;
      this.menuData1 = [] // 一级分类菜单
      this.menuData2 = [] // 二级分类菜单
      this.menuData3 = [] // 三级分类菜单
      this.menuData4 = [] // 四级分类菜单
      this.getLevelOneCategoryList();
      this.getTime();
    },
    // 获取一级目录
    getLevelOneCategoryList (level = this.catograyLevel) {
      this.level = '0';
      // let nextLevel = Number(level) + 1;
      let nextLevel = 1;
      let data = {};
      // 开始请求列表
      ApiRequest(
        this.apiObj.getLevelOneCategoryList.url,
        this.apiObj.getLevelOneCategoryList.type,
        data,
        true
      ).then(res => {
        if (res.retStatus === '1') {
          if (level === '1') {
            this.menuData2 = [];
            this.menuData3 = [];
            this.menuData4 = [];
          } else if (level === '2') {
            this.menuData3 = [];
            this.menuData4 = [];
          } else if (level === '3') {
            this.menuData4 = [];
          }
          this.level = level;
          if (nextLevel <= 5) {
            res.retData.forEach(element => {
              element.nowTime = element.categoryUuid + ',' + this.nowTime;
            });
            this.$data['menuData' + Number(nextLevel)] = res.retData;
            if (res.retData.length === 0) {
              this.lastLevel = true;
            } else {
              this.lastLevel = false;
            }
          }
        }
      });
    },
    // 选中一级分类
    selectFirstMenu (name) {
      name = name.split(',')[0];
      this.catograyLevel = '1';
      this.categoryUuid = name;
      this.formData.categoryUuid = name;
      this.getSubCategory('1');
    },
    // 选中二级分类
    selectSecondMenu (name) {
      name = name.split(',')[0];
      this.catograyLevel = '2';
      this.categoryUuid = name;
      this.formData.categoryUuid = name;
      this.getSubCategory('2');
    },
    // 选中三级分类
    selectThirdMenu (name) {
      name = name.split(',')[0];
      this.catograyLevel = '3';
      this.categoryUuid = name;
      this.formData.categoryUuid = name;
      this.getSubCategory('3');
    },
    // 选中四级分类
    selectFourthMenu (name) {
      name = name.split(',')[0];
      this.catograyLevel = '4';
      this.categoryUuid = name;
      this.formData.categoryUuid = name;
      this.menuData4.forEach(element => {
        if (element.categoryUuid == name) {
          this.allPathName = element.categoryName;
        }
      });
      this.getSubCategory('4');
    },
    // 获取分类路径全名称
    getSubCategory (level = this.catograyLevel) {
      this.level = '0';
      let nextLevel = Number(level) + 1;
      let data = {
        parentUuid: this.categoryUuid,
        categoryType: this.productType
      };
      // 开始请求列表
      ApiRequest(
        this.apiObj.getByParentUuid.url,
        this.apiObj.getByParentUuid.type,
        data,
        true
      ).then(res => {
        if (res.retStatus === '1') {
          if (level === '1') {
            this.menuData2 = [];
            this.menuData3 = [];
            this.menuData4 = [];
          } else if (level === '2') {
            this.menuData3 = [];
            this.menuData4 = [];
          } else if (level === '3') {
            this.menuData4 = [];
          }
          this.level = level;
          if (nextLevel <= 5) {
            res.retData.forEach(element => {
              element.nowTime = element.categoryUuid + ',' + this.nowTime;
            });
            this.$data['menuData' + Number(nextLevel)] = res.retData;
            if (res.retData.length === 0) {
              this.lastLevel = true;
            } else {
              this.lastLevel = false;
            }
          }
        }
      });
    },
    // 选完分类进入下一步操作
    saveClassifyFun () {
      if (this.categoryUuid === 'systemUuid') {
        this.$Message.error('请先选择分类');
        return;
      }
      if (!this.lastLevel) {
        this.$Message.error('请选择到最后一级分类');
        return false;
      }
      this.formData.categoryPath = this.allPathName;
      this.formData.categoryUuid = this.categoryUuid;
    },
    // 编辑
    toEdit (row) {
      let curBtnId = getBtnsId('修改');
      sessionStorage.setItem('buttonId', curBtnId);
      this.uuid = row.uuid;
      this.recordNo = row.recordNo;
      this.supplierCode = row.supplierCode;
      this.productUuid = row.productUuid;
      this.isSaleMultiUnit = row.isSaleMultiUnit;
      this.skuNo = row.skuNo;
      let data = {
        spuNo: row.spuNo
      };
      ApiRequest(
        '/sysback/spu/query/checkPerm?spuNo=' + row.spuNo,
        'post',
        data,
        false
      ).then(res => {
        if (res.retData === 'ok') {
          this.modal2 = true;
        }
      });
    },
    // 查看
    toView (row) {
      handleOpenNewPage(this, {
        path: '/commodity/commodityManage/SPUManage/SPUManageDetail',
        query: { productUuid: row.productUuid, orderType: row.orderType }
      });
    },
    // 设置列
    settingColumn () {
      if (
        this.formData.categoryUuid === '' ||
        this.formData.categoryUuid === null ||
        this.formData.categoryUuid === undefined
      ) {
        this.$Message.error('请先选择分类');
        return false;
      } else {
        this.settingColumnModal = true;
        this.name = '';
        let data = {
          categoryUuid: this.formData.categoryUuid,
          name: this.name
        };
        // 开始请求列表
        ApiRequest(
          this.apiObj.getAllAttrInfoList.url,
          this.apiObj.getAllAttrInfoList.type,
          data,
          true
        ).then(res => {
          if (res.retStatus === '1' && res.retData.length > 0) {
            this.settingColumnData = res.retData;
          } else {
            this.settingColumnData = [];
          }
        });
      }
    },
    // 上移
    toUp (row, index) {
      if (index === 0) {
        this.$Message.error('已经是列表中第一个');
      } else {
        let temp = this.settingColumnData[index - 1];
        this.$set(
          this.settingColumnData,
          index - 1,
          this.settingColumnData[index]
        );
        this.$set(this.settingColumnData, index, temp);
      }
    },
    // 下移
    toDown (row, index) {
      if (index === this.settingColumnData.length - 1) {
        this.$Message.error('已经是列表中最后一个');
      } else {
        let i = this.settingColumnData[index + 1];
        this.$set(
          this.settingColumnData,
          index + 1,
          this.settingColumnData[index]
        );
        this.$set(this.settingColumnData, index, i);
      }
    },
    // 查询/清空
    queryTableBt (type) {
      if (type === '0') {
        this.isSearch = false;
        this.formData.productAddState = '';
        this.formData.categoryPath = '';
        this.formData.spuNo = '';
        this.formData.skuNo = '';
        this.formData.productType = '';
        this.formData.brandName = '';
        this.formData.productName = '';
        this.formData.categoryUuid = '';
      }
      if (this.formData.categoryUuid !== '') {
        this.isSearch = true;
      }
      this.nowPage = 1;
      this.initData();
    },
    // 搜素or清空按钮
    linkAttributeBt (type) {
      if (type === '0') {
        this.name = '';
      }
      this.settingColumn();
    },
    // 导出表格
    async exportTable() {
      let {
        categoryUuid,
        productName,
        spuNo,
        skuNo,
        productType,
        brandName,
        specDetailStr,
        logisticsStock
      } = this.formData;
      let flag = _.some(
        [
          categoryUuid.trim(),
          productName.trim(),
          spuNo.trim(),
          skuNo.trim(),
          productType.trim(),
          brandName.trim(),
          specDetailStr.trim(),
          logisticsStock.trim()
        ],
        Boolean
      );
      if (!flag) {
        this.$Message.warning('请至少输入一个筛选项');
        return;
      }
      const res = await exportSkuManageService(
        this.formData,
        state => {
          this.btnLoading.export = state;
        }
      );
      createExcelByExport({res, excelTitle: `SKU管理导出`});
    },
    settingColumnOkFun (type) {
      if (type === 0) {
        this.nameList = [];
      }
    },
    addModelOkFun () {
      switch (this.myModel) {
        case '1': // 基本信息模板
          handleOpenNewPage(this, {
            name: 'chageFromManageBaseEdit',
            query: { uuid: this.productUuid, type: 'single_sku' }
          });
          break;
        case '2': // 管理信息模板
          handleOpenNewPage(this, {
            name: 'chageFromManageInfoEdit',
            query: { uuid: this.productUuid, type: 'single_sku' }
          });
          break;
        case '3': // SKU信息模板
          handleOpenNewPage(this, {
            name: 'chageFromManageSKUEdit',
            query: {
              uuid: this.productUuid,
              skuNo: this.skuNo,
              type: 'single_sku'
            }
          });
          break;
        case '4': // 供货信息模板
          handleOpenNewPage(this, {
            path:
              '/commodity/commodityInfoUpdate/chageFromManage/chageFromManageSupplyInfo',
            query: { skuNo: this.skuNo, fromType: 'single' }
          });
          break;
        case '5': // 供货参照城市
          if (this.isSaleMultiUnit === '1') {
            // 是钢材
            handleOpenNewPage(this, {
              path:
                '/commodity/commodityManage/chageFromManage/chageFromManageTemplateCitySteel',
              query: {
                skuNo: this.skuNo,
                productUuid: this.productUuid,
                fromType: 'single'
              }
            });
          } else {
            handleOpenNewPage(this, {
              path:
                '/commodity/commodityManage/chageFromManage/chageFromManageTemplateCity',
              query: {
                skuNo: this.skuNo,
                productUuid: this.productUuid,
                fromType: 'single'
              }
            });
          }
          break;
        case '6': // 供货进价信息
          if (this.isSaleMultiUnit === '1') {
            // 是钢材
            handleOpenNewPage(this, {
              path:
                '/commodity/commodityManage/chageFromManage/chageFromManageenterPriceSteel',
              query: { skuNo: this.skuNo, fromType: 'single' }
            });
          } else {
            handleOpenNewPage({
              path:
                '/commodity/commodityManage/chageFromManage/chageFromManageenterPrice',
              query: { skuNo: this.skuNo, fromType: 'single' }
            });
          }
          break;
        case '7': // 供价钢材进价
          handleOpenNewPage(this, {
            path:
              '/commodity/commodityManage/chageFromManage/chageFromManageenterPriceSteel',
            query: { skuNo: this.skuNo, fromType: 'single' }
          });
          break;
        case '10': // 修改图文信息
          handleOpenNewPage(this, {
            path:
              '/commodity/commodityManage/chageFromManage/chageFromManageImageText',
            query: { productUuid: this.productUuid, fromType: 'single' }
          });
          break;
      }
    },
    handleSelect (row) {
      this.nameList = [];
      row.forEach(element => {
        this.nameList.push(element.type + '-' + element.name);
      });
    },
    // 基础列表勾选事件
    handleBaseTablaeSelect (row) {
      this.skuNoList = '';
      row.forEach(element => {
        this.skuNoList += element.skuNo + ',';
      });
    },
    handleChangePage (val) {
      this.pageShow = val;
      this.$nextTick(() => {
        this.initData();
      });
    }
  }
};
</script>
<style>
.ivu-table-wrapper {
  overflow: visible;
}
</style>
